export const userRule = {
	username: [
		{
			required: true,
			message: "用户名不能为空",
			trigger: "blur",
		},
		{
			min: 3,
			max: 8,
			message: "用户名长度在3~8之间",
			trigger: "blur",
		},
	],
	password: [
		{
			required: true,
			message: "登陆密码不能为空",
			trigger: "blur",
		},
		{
			min: 3,
			message: "登陆密码长度大于3位",
			trigger: "blur",
		},
	],
	email: [
		{
			required: true,
			message: "邮箱不能为空",
			trigger: "blur",
		},
		{
			pattern: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
			message: "邮箱格式不正确",
			trigger: "blur",
		}
	],
	mobile: [
		{
			required: true,
			message: "手机不能为空",
			trigger: "blur",
		},
		{
			pattern: /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/,
			message: "手机格式不正确",
			trigger: "blur",
		}
	],
	rid: [
		{
			required: true,
			message: "请选择角色",
			trigger: "change",
		}
	]
}